package com.kky.pp.activity.account

import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.kky.pp.R
import io.rong.imkit.event.EnumEventTag
import com.gyf.immersionbar.ImmersionBar
import com.kky.pp.App
import com.kky.pp.base.TitleMvpBaseActivity
import com.custom.base.base.SDBaseEvent
import com.kky.pp.databinding.ActivityMyAccountBinding


class AccountActivity : TitleMvpBaseActivity<AccountContract.View, AccountPresenter,ActivityMyAccountBinding>(ActivityMyAccountBinding::inflate),
    AccountContract.View {

    override fun isShowBack():Boolean{
        return true
    }

    override fun setTitle(): String {
        return App.app?.resources?.getString(R.string.my_account).toString()
    }

    override fun setFullScreen(): Boolean {
        return true
    }


    override fun onResume() {
        super.onResume()
        ImmersionBar.with(this).statusBarDarkFont(false).init()
    }
    override fun bindLayout(): Int {
        return R.layout.activity_my_account
    }

    override fun initView() {
    }

    //实现“onRequestPermissionsResult”函数接收校验权限结果
    override fun onEventMainThread(event: SDBaseEvent) {
        when (EnumEventTag.valueOf(event.tagInt)) {
            EnumEventTag.MY_ACCOUNT_REFRESH -> {
                mPresenter?.getData()
            }
            else -> {}
        }
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        mPresenter?.onActivityResult(requestCode,resultCode, data)
    }
    override val txtLogOut: TextView
        get() = viewBinding.txtMyAccountLogOut
    override val txtDeleteAccount: TextView
        get() = viewBinding.txtMyAccountDelAccount
    override val imgLoginLogo: ImageView
        get() = viewBinding.imgViewMyAccountLoginLogo
    override val txtLoginWay: TextView
        get() = viewBinding.txtMyAccountLoginWay
    override val googleContainer: ConstraintLayout
        get() = viewBinding.conMyAccountGoogleContainer
    override val txtGoogleBindStatus: TextView
        get() = viewBinding.txtMyAccountGoogleBindStatus
    override val phoneNumberContainer: ConstraintLayout
        get() = viewBinding.conMyAccountPhoneNumberContainer
    override val txtPhoneNumberBindStatus: TextView
        get() = viewBinding.txtMyAccountPhoneNumberBindStatus
    override val tvMiddleTitle: TextView?
        get() = viewBinding.viewTitle.tvMiddleTitle
    override val tvRightTitle: TextView?
        get() = viewBinding.viewTitle.tvRightTitle
    override val ivLeftImage: ImageView?
        get() = viewBinding.viewTitle.ivBackIcon
    override val viewStatusHeight: View?
        get() = viewBinding.viewTitle.viewStatusHeight
}